package com.j.lemon.learn.basic.practice;


import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class People {

    private static final String NUM = "1";

    static{
        System.out.println("static");
    }

    People(){
        System.out.println("constructor 1");
    }
    People(String name){
        this.name=name;
        System.out.println("constructor 2");
    }
    private String name;
    public void run(){
        System.out.println(String.format("%s is running",name));
    }


    public static void main(String[] args) {
        People people = new People();
        people.run();
    }


}
class Man extends People{
    public int num1;
    static {
        System.out.println("man static");
    }

    public Man() {
        System.out.println("man constructor");
    }

    @Override
    public void run() {
        System.out.println("man run");
    }

    static final int tableSizeFor(int cap) {
        int n = cap - 1;
        n |= n >>> 1;
        n |= n >>> 2;
        n |= n >>> 4;
        n |= n >>> 8;
        n |= n >>> 16;
        return n;
    }

    public static void main(String[] args) {
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        try {
            Class<?> aClass = systemClassLoader.loadClass("com.lemon.practice.Man");
            ClassLoader classLoader = aClass.getClassLoader();
            Class<?> aClass1 = classLoader.loadClass("com.lemon.practice.Man");
            String name = aClass1.getName();
            System.out.println(name);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();

        }

        Map<String,String> map = new ConcurrentHashMap<>();

//        m.run();
//        Man m1 = new Man();
//        m1.run();
//        System.out.println(tableSizeFor(15));

        System.out.println(2 & 8);
//        System.out.println(li);
//        System.out.println("done");
//        System.out.println(m.num1);
//        int size=0;
//
//        System.out.println(size++);
//
//        int i= 2147483646 ;
//        System.out.println(i<<1);
//        System.out.println(Integer.MAX_VALUE);
    }
}
